<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI+RPA 跨境业务服务意向收集问卷</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            max-width: 414px;
            margin: 0 auto;
            background: #ffffff;
            position: relative;
        }
        /* 确保容器宽度一致 */
        .container-wrapper {
            max-width: 414px;
            margin: 0 auto;
        }
        /* 主色调蓝紫色 */
        .primary-color {
            color: #6366f1; /* indigo-500 */
        }
        .primary-bg {
            background: #6366f1;
        }
        .primary-light-bg {
            background: #eef2ff; /* indigo-50 */
        }
        /* 卡片浅灰背景 */
        .card-bg {
            background: #f9fafb; /* gray-50 */
        }
        /* 按钮点击效果 */
        .clickable {
            transition: all 0.2s ease;
        }
        .clickable:active {
            transform: scale(0.98);
            opacity: 0.8;
        }
        /* 主按钮（类似参考图的粉色按钮） */
        .primary-button {
            background: #6366f1;
            color: white;
            border: none;
            border-radius: 12px;
            padding: 14px;
            width: 100%;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .primary-button:active {
            background: #4f46e5;
            transform: scale(0.98);
        }
        /* 表单卡片样式 */
        .form-card {
            background: white;
            border-radius: 16px;
            padding: 16px;
            margin-bottom: 20px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        }
        /* 留白充足 */
        .section-spacing {
            margin-bottom: 24px;
        }
        /* 输入框样式 */
        .form-input {
            width: 100%;
            padding: 12px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            font-size: 15px;
            transition: all 0.2s;
            background: #ffffff;
        }
        .form-input:focus {
            outline: none;
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }
        .form-input::placeholder {
            color: #9ca3af;
        }
        /* 选项样式（单选和多选通用） */
        .option-item {
            padding: 12px 16px;
            background: #f9fafb;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            position: relative;
        }
        .option-item:hover {
            border-color: #d1d5db;
            transform: translateY(-1px);
        }
        .option-item:active {
            transform: scale(0.98);
        }
        .option-item.selected {
            border-color: #6366f1;
            background: #eef2ff;
            font-weight: 500;
        }
        .option-item input[type="radio"],
        .option-item input[type="checkbox"] {
            margin-right: 12px;
            width: 18px;
            height: 18px;
            cursor: pointer;
        }
        /* 其他选项输入框 */
        .other-input {
            margin-top: 10px;
            display: none;
        }
        .other-input.show {
            display: block;
        }
        /* 附件上传区域 */
        .upload-area {
            border: 2px dashed #d1d5db;
            border-radius: 12px;
            padding: 32px 16px;
            text-align: center;
            transition: all 0.2s;
            cursor: pointer;
            background: #fafafa;
        }
        .upload-area:hover {
            border-color: #6366f1;
            background: #eef2ff;
        }
        .upload-area:active {
            transform: scale(0.98);
        }
        /* 安全区域适配（iPhone X等） */
        @supports (padding-bottom: env(safe-area-inset-bottom)) {
            .bottom-button-wrapper {
                padding-bottom: env(safe-area-inset-bottom);
            }
        }
    </style>
</head>
<body class="bg-white">
    <!-- 顶部标题栏 -->
    <div class="bg-white px-4 py-3 flex items-center justify-between sticky top-0 z-40 container-wrapper border-b border-gray-100">
        <div class="flex items-center">
            <i class="fas fa-arrow-left text-gray-600 text-xl mr-4 clickable" onclick="window.history.back()" aria-label="返回"></i>
            <div class="text-lg font-semibold text-gray-800">服务意向问卷</div>
        </div>
    </div>

    <!-- 表单内容 -->
    <div class="px-4 py-6 pb-24">
        <!-- 问卷标题 -->
        <div class="mb-6 text-center">
            <h1 class="text-2xl font-bold text-gray-800 mb-2">AI+RPA 跨境业务服务</h1>
            <h2 class="text-lg text-gray-600">意向收集问卷</h2>
        </div>

        <!-- 问题1: 从哪个渠道了解 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>1. 从哪个渠道了解的汤武智能AI+RPA业务？<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleRadio(this, 'channel')">
                    <input type="radio" name="channel" value="friend" onchange="toggleOtherInput('channel', 'friend')">
                    <span>朋友推荐（推荐人_）</span>
                </label>
                <input type="text" placeholder="请输入推荐人" class="form-input other-input" id="channel-friend-input" style="display: none;">
                <label class="option-item" onclick="toggleRadio(this, 'channel')">
                    <input type="radio" name="channel" value="meeting" onchange="toggleOtherInput('channel', 'meeting')">
                    <span>知无不言大会</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'channel')">
                    <input type="radio" name="channel" value="website" onchange="toggleOtherInput('channel', 'website')">
                    <span>知无不言网站</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'channel')">
                    <input type="radio" name="channel" value="city" onchange="toggleOtherInput('channel', 'city')">
                    <span>同城会活动</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'channel')">
                    <input type="radio" name="channel" value="other" onchange="toggleOtherInput('channel', 'other')">
                    <span>其他_</span>
                </label>
                <input type="text" placeholder="请注明" class="form-input other-input" id="channel-other-input" style="display: none;">
            </div>
        </div>

        <!-- 问题2: 跨境业务主要平台 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>2. 您目前从事的跨境业务主要平台是？<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="amazon">
                    <span>亚马逊</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="walmart">
                    <span>Walmart</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="tiktok">
                    <span>TikTok</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="temu">
                    <span>Temu</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="coupang">
                    <span>Coupang</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="shopee">
                    <span>Shopee</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="aliexpress">
                    <span>速卖通</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="lazada">
                    <span>Lazada</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="platform" value="other" onchange="toggleOtherInput('platform', 'other')">
                    <span>其他（请注明）</span>
                </label>
                <input type="text" placeholder="请注明" class="form-input other-input" id="platform-other-input" style="display: none;">
            </div>
        </div>

        <!-- 问题3: 年销售额 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>3. 您目前业务团队的年销售额是？<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleRadio(this, 'sales')">
                    <input type="radio" name="sales" value="under20m">
                    <span>2 千万人民币以内</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'sales')">
                    <input type="radio" name="sales" value="20-50m">
                    <span>2 - 5 千万人民币</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'sales')">
                    <input type="radio" name="sales" value="50-100m">
                    <span>5 千万 - 1 亿人民币</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'sales')">
                    <input type="radio" name="sales" value="100-300m">
                    <span>1 - 3 亿人民币</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'sales')">
                    <input type="radio" name="sales" value="over300m">
                    <span>3 亿人民币以上</span>
                </label>
            </div>
        </div>

        <!-- 问题4: 团队规模 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>4. 您的跨境业务团队规模大约是？<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleRadio(this, 'teamSize')">
                    <input type="radio" name="teamSize" value="under10">
                    <span>10 人及以下</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'teamSize')">
                    <input type="radio" name="teamSize" value="11-50">
                    <span>11 - 50 人</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'teamSize')">
                    <input type="radio" name="teamSize" value="50-100">
                    <span>50 - 100 人</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'teamSize')">
                    <input type="radio" name="teamSize" value="over100">
                    <span>100 人以上</span>
                </label>
            </div>
        </div>

        <!-- 问题5: 是否有技术开发团队 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>5. 您目前业务团队是否有技术开发团队？<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleRadio(this, 'hasTech')">
                    <input type="radio" name="hasTech" value="yes">
                    <span>是</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'hasTech')">
                    <input type="radio" name="hasTech" value="no">
                    <span>否</span>
                </label>
            </div>
        </div>

        <!-- 问题6: 最困扰的问题 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>6. 您在跨境运营中，最困扰的问题是？<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="review">
                    <span>差评处理效率低</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="account">
                    <span>多平台账号手动管理繁琐</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="listing">
                    <span>多平台产品上架效率低</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="research">
                    <span>产品市场调研量大、需求分析难</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="inventory">
                    <span>库存数据同步延迟 / 断货压货</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="data">
                    <span>销售数据无法可视化 (图表) 分析</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="monitor">
                    <span>库存 / 绩效 / 广告等无及时监控提醒</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="influencer">
                    <span>站外红人 / 达人筛选邀约耗时</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="ad">
                    <span>产品多，无法及时给每个产品创建广告</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="hr">
                    <span>招聘 / 人事流程耗时长</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="finance">
                    <span>财务对账复杂、合规成本高</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="problems" value="other" onchange="toggleOtherInput('problems', 'other')">
                    <span>其他（请注明）</span>
                </label>
                <input type="text" placeholder="请注明" class="form-input other-input" id="problems-other-input" style="display: none;">
            </div>
        </div>

        <!-- 问题7: 是否使用过RPA -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>7. 您是否使用过 RPA（机器人流程自动化）处理跨境业务中的重复任务（如数据录入、报表下载）？<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleRadio(this, 'rpa')">
                    <input type="radio" name="rpa" value="never">
                    <span>从未使用</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'rpa')">
                    <input type="radio" name="rpa" value="considered">
                    <span>考虑过但未尝试</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'rpa')">
                    <input type="radio" name="rpa" value="small">
                    <span>已在小范围使用</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'rpa')">
                    <input type="radio" name="rpa" value="wide">
                    <span>广泛应用于多个场景</span>
                </label>
            </div>
        </div>

        <!-- 问题8: 最希望优先解决的环节 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>8. 若引入 AI+RPA 服务，您最希望优先解决哪个环节的问题？<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleRadio(this, 'priority')">
                    <input type="radio" name="priority" value="operation" onchange="toggleOtherInput('priority', 'operation')">
                    <span>运营管理（如 Listing 优化、批量上架）</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'priority')">
                    <input type="radio" name="priority" value="inventory" onchange="toggleOtherInput('priority', 'inventory')">
                    <span>库存物流（如库存预警、物流追踪）</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'priority')">
                    <input type="radio" name="priority" value="ad" onchange="toggleOtherInput('priority', 'ad')">
                    <span>广告投放（如自动建广告、关键词优化）</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'priority')">
                    <input type="radio" name="priority" value="finance" onchange="toggleOtherInput('priority', 'finance')">
                    <span>财务合规（如多平台对账、税务处理）</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'priority')">
                    <input type="radio" name="priority" value="hr" onchange="toggleOtherInput('priority', 'hr')">
                    <span>人事行政（如简历筛选、考勤统计）</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'priority')">
                    <input type="radio" name="priority" value="other" onchange="toggleOtherInput('priority', 'other')">
                    <span>其他（请注明）</span>
                </label>
                <input type="text" placeholder="请注明" class="form-input other-input" id="priority-other-input" style="display: none;">
            </div>
        </div>

        <!-- 问题9: 预算 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>9. 您的预算<span class="text-red-500">*</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleRadio(this, 'budget')">
                    <input type="radio" name="budget" value="under30k">
                    <span>3W 元以内</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'budget')">
                    <input type="radio" name="budget" value="30-60k">
                    <span>3W - 6W 元</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'budget')">
                    <input type="radio" name="budget" value="60-100k">
                    <span>6W - 10W 元</span>
                </label>
                <label class="option-item" onclick="toggleRadio(this, 'budget')">
                    <input type="radio" name="budget" value="over100k">
                    <span>10W 元以上</span>
                </label>
            </div>
        </div>

        <!-- 问题10: ERP工具 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>10. 您团队目前使用的 ERP 工具是哪些？<span class="text-gray-400 text-sm">（选填）</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="erp" value="lingxing">
                    <span>领星 ERP</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="erp" value="saihu">
                    <span>赛狐 ERP</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="erp" value="mabang">
                    <span>马帮 ERP</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="erp" value="dianxiaomi">
                    <span>店小秘 ERP</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="erp" value="self">
                    <span>自研系统</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="erp" value="other" onchange="toggleOtherInput('erp', 'other')">
                    <span>其他</span>
                </label>
                <input type="text" placeholder="请注明" class="form-input other-input" id="erp-other-input" style="display: none;">
            </div>
        </div>

        <!-- 问题11: 第三方软件工具 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>11. 您团队目前使用的第三方软件工具是哪些？<span class="text-gray-400 text-sm">（选填）</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="seller">
                    <span>卖家精灵</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="xiyou">
                    <span>西柚找词</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="helium">
                    <span>Helium 10</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="sif">
                    <span>SIf 关键词</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="keepa">
                    <span>Keepa</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="jungle">
                    <span>Jungle Scout</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="feiyu">
                    <span>飞鱼数据</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="sonar">
                    <span>Sonar</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="oulu">
                    <span>欧鹭</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="tools" value="other" onchange="toggleOtherInput('tools', 'other')">
                    <span>其他</span>
                </label>
                <input type="text" placeholder="请注明" class="form-input other-input" id="tools-other-input" style="display: none;">
            </div>
        </div>

        <!-- 问题12: 办公通讯软件 -->
        <div class="form-card">
            <label class="block text-gray-700 font-medium mb-3">
                <span>12. 您团队目前内部使用的办公通讯软件是哪些？<span class="text-gray-400 text-sm">（选填）</span></span>
            </label>
            <div class="space-y-2">
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="communication" value="feishu">
                    <span>飞书</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="communication" value="dingding">
                    <span>钉钉</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="communication" value="wechat-work">
                    <span>企业微信</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="communication" value="wechat">
                    <span>微信</span>
                </label>
                <label class="option-item" onclick="toggleCheckbox(this)">
                    <input type="checkbox" name="communication" value="other" onchange="toggleOtherInput('communication', 'other')">
                    <span>其他</span>
                </label>
                <input type="text" placeholder="请注明" class="form-input other-input" id="communication-other-input" style="display: none;">
            </div>
        </div>
    </div>

    <!-- 底部提交按钮 -->
    <div class="fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 p-4 bottom-button-wrapper z-50" style="max-width: 414px; margin: 0 auto;">
        <button class="primary-button clickable" onclick="submitRequirement()">
            <i class="fas fa-paper-plane mr-2"></i>
            提交问卷
        </button>
    </div>

    <script>
        // 切换单选选项
        function toggleRadio(element, name) {
            const radio = element.querySelector('input[type="radio"]');
            if (radio) {
                radio.checked = true;
                // 触发change事件以更新输入框显示
                radio.dispatchEvent(new Event('change'));
                // 移除同组其他选项的选中样式
                document.querySelectorAll(`input[name="${name}"]`).forEach(input => {
                    const parent = input.closest('.option-item');
                    if (parent) {
                        parent.classList.remove('selected');
                    }
                });
                // 添加当前选项的选中样式
                element.classList.add('selected');
            }
        }

        // 切换多选选项
        function toggleCheckbox(element) {
            const checkbox = element.querySelector('input[type="checkbox"]');
            if (checkbox) {
                checkbox.checked = !checkbox.checked;
                if (checkbox.checked) {
                    element.classList.add('selected');
                } else {
                    element.classList.remove('selected');
                }
            }
        }

        // 显示/隐藏"其他"输入框
        function toggleOtherInput(group, value) {
            const inputId = `${group}-${value}-input`;
            const input = document.getElementById(inputId);
            if (input) {
                const inputElement = document.querySelector(`input[name="${group}"][value="${value}"]`);
                if (inputElement && inputElement.checked) {
                    input.style.display = 'block';
                    input.classList.add('show');
                } else {
                    input.style.display = 'none';
                    input.classList.remove('show');
                    input.value = '';
                }
            }
            
            // 特殊处理：问题1中，当选择非"朋友推荐"和非"其他"的选项时，隐藏所有输入框
            if (group === 'channel') {
                const selectedChannel = document.querySelector('input[name="channel"]:checked');
                if (selectedChannel) {
                    const friendInput = document.getElementById('channel-friend-input');
                    const otherInput = document.getElementById('channel-other-input');
                    
                    if (selectedChannel.value === 'friend') {
                        if (friendInput) {
                            friendInput.style.display = 'block';
                            friendInput.classList.add('show');
                        }
                        if (otherInput) {
                            otherInput.style.display = 'none';
                            otherInput.classList.remove('show');
                            otherInput.value = '';
                        }
                    } else if (selectedChannel.value === 'other') {
                        if (friendInput) {
                            friendInput.style.display = 'none';
                            friendInput.classList.remove('show');
                            friendInput.value = '';
                        }
                        if (otherInput) {
                            otherInput.style.display = 'block';
                            otherInput.classList.add('show');
                        }
                    } else {
                        // 选择其他选项时，隐藏所有输入框
                        if (friendInput) {
                            friendInput.style.display = 'none';
                            friendInput.classList.remove('show');
                            friendInput.value = '';
                        }
                        if (otherInput) {
                            otherInput.style.display = 'none';
                            otherInput.classList.remove('show');
                            otherInput.value = '';
                        }
                    }
                }
            }
        }

        // 初始化：为已选中的选项添加样式
        document.addEventListener('DOMContentLoaded', function() {
            // 处理单选
            document.querySelectorAll('input[type="radio"]:checked').forEach(radio => {
                const parent = radio.closest('.option-item');
                if (parent) {
                    parent.classList.add('selected');
                }
            });
            // 处理多选
            document.querySelectorAll('input[type="checkbox"]:checked').forEach(checkbox => {
                const parent = checkbox.closest('.option-item');
                if (parent) {
                    parent.classList.add('selected');
                }
            });
        });

        // 提交问卷
        function submitRequirement() {
            // 验证必填项
            const channel = document.querySelector('input[name="channel"]:checked');
            if (!channel) {
                alert('请选择了解渠道');
                return;
            }

            const platforms = document.querySelectorAll('input[name="platform"]:checked');
            if (platforms.length === 0) {
                alert('请至少选择一个跨境业务平台');
                return;
            }

            const sales = document.querySelector('input[name="sales"]:checked');
            if (!sales) {
                alert('请选择年销售额');
                return;
            }

            const teamSize = document.querySelector('input[name="teamSize"]:checked');
            if (!teamSize) {
                alert('请选择团队规模');
                return;
            }

            const hasTech = document.querySelector('input[name="hasTech"]:checked');
            if (!hasTech) {
                alert('请选择是否有技术开发团队');
                return;
            }

            const problems = document.querySelectorAll('input[name="problems"]:checked');
            if (problems.length === 0) {
                alert('请至少选择一个困扰的问题');
                return;
            }

            const rpa = document.querySelector('input[name="rpa"]:checked');
            if (!rpa) {
                alert('请选择RPA使用情况');
                return;
            }

            const priority = document.querySelector('input[name="priority"]:checked');
            if (!priority) {
                alert('请选择最希望优先解决的环节');
                return;
            }

            const budget = document.querySelector('input[name="budget"]:checked');
            if (!budget) {
                alert('请选择预算范围');
                return;
            }

            // 收集所有数据
            const formData = {
                channel: channel.value,
                channelOther: document.getElementById('channel-other-input')?.value || '',
                channelFriend: document.getElementById('channel-friend-input')?.value || '',
                platforms: Array.from(platforms).map(p => p.value),
                platformOther: document.getElementById('platform-other-input')?.value || '',
                sales: sales.value,
                teamSize: teamSize.value,
                hasTech: hasTech.value,
                problems: Array.from(problems).map(p => p.value),
                problemsOther: document.getElementById('problems-other-input')?.value || '',
                rpa: rpa.value,
                priority: priority.value,
                priorityOther: document.getElementById('priority-other-input')?.value || '',
                budget: budget.value,
                erp: Array.from(document.querySelectorAll('input[name="erp"]:checked')).map(e => e.value),
                erpOther: document.getElementById('erp-other-input')?.value || '',
                tools: Array.from(document.querySelectorAll('input[name="tools"]:checked')).map(t => t.value),
                toolsOther: document.getElementById('tools-other-input')?.value || '',
                communication: Array.from(document.querySelectorAll('input[name="communication"]:checked')).map(c => c.value),
                communicationOther: document.getElementById('communication-other-input')?.value || ''
            };

            console.log('问卷数据:', formData);
            
            // 模拟提交
            alert('问卷提交成功！感谢您的填写。');
            // 这里可以添加实际的提交逻辑
            // window.location.href = 'customer-requirement-list.html';
        }
    </script>
</body>
</html>

